package pl.pawluk.inz.exceptions;

/**
 * @author: Piotr Pawluk
 * Date: 09.03.13
 * Time: 18:04
 * To change this template use File | Settings | File Templates.
 */
public class VLPException extends RuntimeException {
    private final int code;
    private final Object[] args;

    public VLPException(Throwable t) {
        super(t);
        code = -1;
        args = new Object[0];
    }

    public VLPException(int code, Object... args) {
        this.code = code;
        this.args = args;
    }

    public int getCode() {
        return code;
    }

    public String getErrorCode() {
        return ErrorCodes.ERROR_PREFIX + code;
    }

    public Object[] getArgs() {
        return args;
    }

    public static final String TECHNICAL_ERROR_CODE = ErrorCodes.ERROR_PREFIX+ErrorCodes.BLAD_TECHNICZNY;
}
